package com.cabal.common.enums;

/**
 * 国家编码枚举
 * 
 * @author shenkang
 * @date 2022年11月24日
 */
public enum CountyEnum {
	CN("CN", "86", "中国"), AU("AU", "61", "澳大利亚");

	private String code;
	private String phoneCode;
	private String name;

	CountyEnum(String code, String phoneCode, String name) {
		this.code = code;
		this.phoneCode = phoneCode;
		this.name = name;
	}

	public static CountyEnum getByCode(String code) {
		CountyEnum[] countyEnums = CountyEnum.values();
		for (CountyEnum countyEnum : countyEnums) {
			if (countyEnum.code.equals(code)) {
				return countyEnum;
			}
		}

		return null;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getPhoneCode() {
		return phoneCode;
	}

	public void setPhoneCode(String phoneCode) {
		this.phoneCode = phoneCode;
	}
}
